package com.chanyachting.emall.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

import com.chanyachting.emall.util.RequestUtil;

public class MemberopertionmenuForm extends ActionForm {
	
	
	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String menuIdArray;
	private java.lang.Integer memberId;
	private java.lang.Integer menuGroupId;
	
	
	
	
	@Override
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		
		ActionErrors errors=new ActionErrors();
		
		RequestUtil ru=new RequestUtil(request);
		
		if(this.getMenuGroupId().equals(0)){
			
			errors.add("",new ActionMessage(""));
			
			ru.setMsg("菜单组不能为空！");
			
		}
		
		if(this.getMenuIdArray()==null || this.getMenuIdArray().trim().equals("")){
			
			errors.add("",new ActionMessage(""));
			
			ru.setMsg("菜单列表不能为空！");
			
		}
		
		
		if(this.getMemberId().equals(0)){
			
			errors.add("",new ActionMessage(""));
			
			ru.setMsg("会员编号不能为空！");
		}
		
		
		return errors;
	}
	
	
	public java.lang.Integer getId() {
		return id;
	}
	public void setId(java.lang.Integer id) {
		this.id = id;
	}
	public java.lang.String getMenuIdArray() {
		return menuIdArray;
	}
	public void setMenuIdArray(java.lang.String menuIdArray) {
		this.menuIdArray = menuIdArray;
	}
	public java.lang.Integer getMemberId() {
		return memberId;
	}
	public void setMemberId(java.lang.Integer memberId) {
		this.memberId = memberId;
	}
	public java.lang.Integer getMenuGroupId() {
		return menuGroupId;
	}
	public void setMenuGroupId(java.lang.Integer menuGroupId) {
		this.menuGroupId = menuGroupId;
	}
	
	
	

}
